package com.sphd.emanu.activity.pointconsume;

import android.content.Context;
import android.util.Log;

import com.google.gson.JsonObject;
import com.sphd.emanu.mvp.BasePresenterImpl;
import com.wzutils.L;

import java.math.BigDecimal;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;

/**
 * MVPPlugin
 *  邮箱 784787081@qq.com
 */

public class PointconsumePresenter extends BasePresenterImpl<PointconsumeContract.View> implements PointconsumeContract.Presenter{

    @Override
    public void updatePayPoints(Integer id2, boolean enable2, String type2, BigDecimal amount2, Integer points2, Integer id3, boolean enable3, String type3, BigDecimal amount3, Integer points3) {
        emanuService.updatePayPoints(id2, enable2, type2, amount2, points2, id3, enable3, type3, amount3, points3).enqueue(new Callback<JsonObject>() {
            @Override
            public void onResponse(Call<JsonObject> call, Response<JsonObject> response) {
                L.e(response.toString());
                mView.recRes(res(response));
            }

            @Override
            public void onFailure(Call<JsonObject> call, Throwable t) {
                Error(t);
            }
        });
    }
}
